import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    name: 'home',
    redirect: '/index',
    component: () => import('@/views/home'),
    children: [
      {
        path: '/index',
        name: 'Index',
        meta: {
          title: '首页',
        },
        component: () => import('@/views/index')
      },
      {

        path: '/customForm',
        name: 'customForm',
        meta: {
          title: '编辑自定义模板',
        },
        component: () => import('@/views/customFormManagement/customForm')
      },
      {
        path: '/customFormList',
        name: 'customFormList',
        meta: {
          title: '自定义表单列表',
        },
        component: () => import('@/views/customFormManagement/customFormList')
      },
      {
        path: "/personnelList",
        name: 'personnelList',
        meta: {
          title: '人员列表'
        },
        component: () => import('@/views/organizationalStructure/personnelList')
      },
      {
        path: "/organizationalStructure",
        name: 'organizationalStructure',
        meta: {
          title: '组织架构'
        },
        component: () => import('@/views/organizationalStructure/organizationalStructure')
      },
      {
        path: "/workflowList",
        name: 'workflowList',
        meta: {
          title: '工作流列表'
        },
        component: () => import('@/views/workflowManagement/workflowList')
      },
      {
        path: "/role",
        name: 'role',
        meta: {
          title: '角色管理'
        },
        component: () => import('@/views/system/role')
      },
      {
        path: '/approvalList',
        name: 'approvalList',
        meta: {
          title: '审批列表',
        },
        component: () => import('@/views/approval/approvalList')
      },
      {
        path: '/approvedList',
        name: 'approvedList',
        meta: {
          title: '已审批列表',
        },
        component: () => import('@/views/approval/approvedList')
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login'),
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
